using System.ComponentModel;

namespace Coffee.DataModels
{

    public class DataModel
    {

        public virtual object GetProperty(string propertyName)
        {
            PropertyDescriptorCollection props = null;
            PropertyDescriptor property = null;
            props = TypeDescriptor.GetProperties(this.GetType());
            property = props[propertyName];
            return property.GetValue(this);
        }

        public virtual void SetProperty(string propertyName, object value)
        {
            PropertyDescriptorCollection props = null;
            PropertyDescriptor property = null;
            props = TypeDescriptor.GetProperties(this.GetType());
            property = props[propertyName];
            property.SetValue(this, value);
        }

    }
}